from urllib.error import URLError
from urllib.request import ProxyHandler , build_opener


proxy_hander = ProxyHandler({
    'http': 'http://127.0.0.1:80',
    'https': 'https://127.0.0.1:80'
    
})
opener = build_opener(proxy_hander)
try:
    response = opener.open('https://172.0.0.1')
    print(response.read().decode('utf-8'))
    print(response.head())
except URLError as e:
    print(e.reason)
